-
Notifications
You must be signed in to change notification settings - Fork 663
HtmlEditor and Chat AI Demos: Create an AI service to make demo code more readable #32154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HtmlEditor and Chat AI Demos: Create an AI service to make demo code more readable #32154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors AI integration code in HtmlEditor and Chat demos by extracting AI service logic into dedicated service files, improving code organization and readability across all framework implementations (Angular, React, ReactJs, and Vue).
Key Changes:
- Created separate service files containing AI integration logic (service.ts/service.js) for both HtmlEditor and Chat demos
- Removed AI service implementation from component files and data files
- Updated imports to use the new service modules
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/demos/Demos/HtmlEditor/AITextEditing/Vue/service.ts | New service file exporting aiIntegration instance with OpenAI integration logic |
| apps/demos/Demos/HtmlEditor/AITextEditing/Vue/App.vue | Updated to import aiIntegration from service.ts instead of defining it inline |
| apps/demos/Demos/HtmlEditor/AITextEditing/ReactJs/service.js | New service file with AI integration logic and config |
| apps/demos/Demos/HtmlEditor/AITextEditing/ReactJs/data.js | Removed AI integration code moved to service.js |
| apps/demos/Demos/HtmlEditor/AITextEditing/ReactJs/App.js | Updated imports to use service.js |
| apps/demos/Demos/HtmlEditor/AITextEditing/React/service.ts | New TypeScript service file with AI integration logic |
| apps/demos/Demos/HtmlEditor/AITextEditing/React/data.ts | Removed AI integration code moved to service.ts |
| apps/demos/Demos/HtmlEditor/AITextEditing/React/App.tsx | Updated imports to use service.ts |
| apps/demos/Demos/HtmlEditor/AITextEditing/Angular/app/app.service.ts | Removed AzureOpenAIConfig and getAzureOpenAIConfig method |
| apps/demos/Demos/HtmlEditor/AITextEditing/Angular/app/app.component.ts | Refactored to use AiService instead of inline AI logic |
| apps/demos/Demos/HtmlEditor/AITextEditing/Angular/app/ai/ai.service.ts | New Angular service encapsulating AI integration logic |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/Vue/service.ts | New service file exporting getAIResponse function |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/Vue/data.ts | Removed AzureOpenAIConfig moved to service.ts |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/Vue/App.vue | Updated to import getAIResponse from service.ts |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/ReactJs/useApi.js | Updated to import getAIResponse from service.js |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/ReactJs/service.js | New service file with AI response logic |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/ReactJs/data.js | Removed AzureOpenAIConfig moved to service.js |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/React/useApi.ts | Updated to import getAIResponse and Message type from service.ts |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/React/service.ts | New TypeScript service file with AI response logic and Message type export |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/React/data.ts | Removed AzureOpenAIConfig moved to service.ts |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/Angular/app/app.service.ts | Refactored to use AiService for AI responses |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/Angular/app/app.component.ts | Added AiService to providers |
| apps/demos/Demos/Chat/AIAndChatbotIntegration/Angular/app/ai/ai.service.ts | New Angular service for AI integration |
apps/demos/Demos/Chat/AIAndChatbotIntegration/ReactJs/service.js
Outdated
Show resolved
Hide resolved
apps/demos/Demos/Chat/AIAndChatbotIntegration/Angular/app/app.service.ts
Outdated
Show resolved
Hide resolved
6ad3c31 to
d25c52d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 9 comments.
apps/demos/Demos/Chat/AIAndChatbotIntegration/Angular/app/ai/ai.service.ts
Show resolved
Hide resolved
apps/demos/Demos/Chat/AIAndChatbotIntegration/Angular/app/app.service.ts
Show resolved
Hide resolved
83dd370 to
32a051a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
No description provided.